<?php include '_init_.php';?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta name="description" content="最佳的兒童攝影工作室" />
<meta name="KEYWORDS" CONTENT=" 兒童攝影,個人形象寫真,全家福,寶寶照,個人寫真" />
<meta name="rating" CONTENT="general" /> 
<meta name="robots" content="index,follow"/>
<META HTTP-EQUIV="Pragma" CONTENT="no_cache">
<title>班尼頓寫真攝影</title>
<link href="css/bodyc.css" rel="stylesheet" type="text/css" />
<link href="css/index.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="js/jquery-latest.min.js"></script>
<script type="text/javascript">
	//  右邊廣告選單 當網頁載入完
	$(window).load(function(){
		var $win = $(window),
			$ad = $('#right_ad').css('opacity', 0).show(),	// 讓廣告區塊變透明且顯示出來
			_width = $ad.width(),
			_height = $ad.height(),
			_diffY = 34, _diffX = 6,	// 距離右及上方邊距
			_moveSpeed = 1000;	// 移動的速度
		
		// 先把 #abgne_float_ad 移動到定點
		$ad.css({
			top: _diffY,	// 往上
			left: $win.width() - _width - _diffX,
			opacity: 1
		});
		
		// 幫網頁加上 scroll 及 resize 事件
		$win.bind('scroll resize', function(){
			var $this = $(this);
			
			// 控制 #abgne_float_ad 的移動
			$ad.stop().animate({
				top: $this.scrollTop() + _diffY,	// 往上
				left: $this.scrollLeft() + $this.width() - _width - _diffX
			}, _moveSpeed);
		}).scroll();	// 觸發一次 scroll()
		
		// 關閉廣告
		$('#right_ad .close_ad').click(function(){
			$ad.hide();
		});
	});
</script>
<script type="text/javascript">
	$(function(){
		// 幫 #menu li 加上 hover 事件
		$('#menu>li').hover(function(){
			// 先找到 li 中的子選單
			var _this = $(this),
				_subnav = _this.children('ul');
			
			// 變更目前母選項的背景顏色
			// 同時淡入子選單(如果有的話)
			_this.css('backgroundColor', '#fff');
			_subnav.stop(true, true).fadeIn(400);
		} , function(){
			// 變更目前母選項的背景顏色
			// 同時淡出子選單(如果有的話)
			// 也可以把整句拆成上面的寫法
			$(this).css('backgroundColor', 'fff').children('ul').stop(true, true).fadeOut(400);
		});
		
		// 取消超連結的虛線框
		$('a').focus(function(){
			this.blur();
		});
	});
</script>
</head>

<body>
<div id="wrap"><!-- star #wrap //-->
<div id="contact-body" class="clearfix"><!-- star #main //-->

<?php include_once('topb.php');?>

<div id="main-body" class="clearfix"><!-- star #contact-body //-->
  <?php include_once('top-ad.php');?>
  
<div id="hot"><!-- star #ad //-->
  <?php include_once('banner.php');?>
</div><!-- end #ad //-->
  <div id="news"><!-- star #news //-->
  <ul >
  <li class="news-a">
    <h2>News</h2>
    <h4>班尼頓的最新活動訊息</h4>
    </li>
    <?php 
    $news_count = count($GLOBALS['PAGE_DATA_NEWS_MEDIA_ACTIVITY']);
    if($news_count > 0){
    $first_news = $GLOBALS['PAGE_DATA_NEWS_MEDIA_ACTIVITY'][0];
    $link_href = $GLOBALS['APP_INSTANCE']->get_article_detail_page_url($first_news);
    ?>
    <li class="news-c">
    <p class="news-ca"><?php echo $GLOBALS['GV_ARTICLE_SUB_CAT'][$first_news['cat_id']][$first_news['sub_cat_id']];?></p>
    <p class="news-cb"><?php echo date('Y . M', strtotime($first_news['date']));?></p>
    </li>
    </ul>
    <ul >
  <li class="news-cc"> <a href="<?php echo $link_href;?>"><img src="img/article/<?php echo $first_news['img_path'];?>" alt="班尼頓舉辦寶寶抓周活動" width="140" height="140" /></a> </li>
    <li class="news-cd"><h3><?php echo $first_news['title'];?> </h3></li>     
    <li class="news-ce">
    <a href="#" onclick="javascript:addFacebook();return false;"><img src="images/fb-1.png" width="21" height="21" /></a>
    </li>
    <li class="news-cf">
    <?php 
    printf('<a href="%s">%s</a>',$link_href, $GLOBALS['APP_INSTANCE']->trim_html_content($first_news['content'], 102));
    ?>
  </li> 
    <li class="news-cg"> </li>         
    </ul>
    <?php }?>
    
    <?php if( $news_count > 1){
    	echo '<ul>';
   		for($i = 1; $i < $news_count; $i++)
    	{
    		$row = $GLOBALS['PAGE_DATA_NEWS_MEDIA_ACTIVITY'][$i];
    		$link_href = $GLOBALS['APP_INSTANCE']->get_article_detail_page_url($row);
    		printf('<li class="news-ch">%s</li>',date('D.m/d',strtotime($row['date'])));
    		printf('<li class="news-ci">%s</li>',$GLOBALS['GV_ARTICLE_SUB_CAT'][$row['cat_id']][$row['sub_cat_id']]);
    		printf('<li class="news-cj"><a href="%s">%s</a></li>',$link_href, $GLOBALS['APP_INSTANCE']->trim_html_content($row['content'], 40));
    	}
    }
    echo '<li class="news-cg"> </li>';
    echo '</ul>';
    ?>
    
  </div><!-- end #news //-->
  <div id="bloga"><!-- star #bloga //-->
  <div class="news-a">
    <h2> Famous </h2>
    <h4>班尼頓寫真本月精選主題
    </h4></div>
    <?php if($GLOBALS['PAGE_DATA_FAMOUS']):?>
    <?php 
   		 $link_href = $GLOBALS['APP_INSTANCE']->get_article_detail_page_url($GLOBALS['PAGE_DATA_FAMOUS']);
    ?>
  <ul>
    <li class="bloga-a"><a href="<?php echo $link_href;?>"><img src="img/article/<?php echo $GLOBALS['PAGE_DATA_FAMOUS']['img_path'];?>" alt="<?php echo $GLOBALS['PAGE_DATA_FAMOUS']['title'];?>" width="430" height="300" /></a></li>
     <li class="bloga-b"><?php echo date('Y . M', strtotime($GLOBALS['PAGE_DATA_FAMOUS']['date']));?></li>
    <li class="bloga-c">
    <h3><?php echo $GLOBALS['PAGE_DATA_FAMOUS']['title'];?></h3>
    </li>
    <li class="bloga-d"><a href="<?php echo $link_href;?>"><?php echo $GLOBALS['APP_INSTANCE']->trim_html_content($GLOBALS['PAGE_DATA_FAMOUS']['content'], 145);?></a></li> 
  </ul>
  <?php endif;?>
  
  </div><!-- end #bloga //-->
  <div id="blogb"><!-- star #blogb //-->
  <div class="news-a">
    <h2> Famous </h2>
    <h4>班尼頓的官方部落格</h4></div>
    <div class="news-b">
      <a href="people.php">More</a></div>
  </div> <!-- end #blogb //-->
  <div id="blogb2"><!-- star #blogb2 //-->
   <?php foreach($GLOBALS['PAGE_DATA_FAMOUS_LIST'] as $row):?>
   <?php 
   $link_href = $GLOBALS['APP_INSTANCE']->get_article_detail_page_url($row);
   ?>
         <ul>
      <li class="blogb2-a"><a href="<?php echo $link_href;?>"><img src="img/article/<?php echo $row['img_path'];?>"  alt="<?php echo $row['title'];?>" width="120" height="80" /></a>
      </li>
      <li class="blogb2-b"><?php echo date('Y.m.d',strtotime($row['date']));?></li>
      <li class="blogb2-c"><h3><?php echo $row['title'];?></h3>
      </li>
      <li class="blogb2-d"><a href="<?php echo $link_href;?>"><?php echo $GLOBALS['APP_INSTANCE']->trim_html_content($row['content'], 145);?></a></li>
    </ul>
     <?php endforeach;?>
 
  </div><!-- end #blogb2 //-->
<div id="work"><!-- star #work //-->
  <div class="news-a">
    <h2> Photos </h2>
    <h4>請您細細品味班尼頓寫真的作品</h4></div>
    <div class="news-b">
      <a href="working.php">More</a></div>
</div><!-- end #work //-->
<div id="work2">
<?php foreach($GLOBALS['PAGE_DATA_INDEX_WORKING']  as $row):?>
  <ul>
    <li class="work2-a"> 
    <?php 
    if ( $row['url']) {
    	$url = Util::enhanceUrl($row['url']);
    	printf('<a href="%s"><img src="img/index_work_ad/%s" alt="<?php echo $cat_name;?>" width="190" height="190" /></a>',$url,$row['img']);
    }else{
    	printf('<img src="img/index_work_ad/%s" alt="<?php echo $cat_name;?>" width="190" height="190" />',$row['img']);
    }
    ?>
    
    </li>
      <li class="work2-b"><?php echo $row['title'];?></li> 
  </ul>
<?php endforeach;?>

</div>
</div><!-- end #contact //-->
</div><!-- end #main //-->
</div><!-- end #wrap //-->
<?php include_once('right-ad.php');?>

  <?php include_once('footer.php');?>
</body>
</html>